
public class BoardMove {

	private int toFile;
	private int toRank;
	private char promoteType = '\0';
	private boolean attacking = false;
	
	public BoardMove(BoardCell cell) {
		setToFile(cell.getFile());
		setToRank(cell.getRank());
	}
	
	public BoardMove(BoardCell cell, char promoteType) {
		setToFile(cell.getFile());
		setToRank(cell.getRank());
		this.promoteType = promoteType;
	}
	
	public BoardMove(int toFile, int toRank) {
		setToFile(toFile);
		setToRank(toRank);
	}
	
	public int getToFile() {
		return toFile;
	}
	
	public int getToRank() {
		return toRank;
	}
	
	public void setToFile(int toFile) {
		this.toFile = toFile;
	}
	
	public void setToRank(int toRank) {
		this.toRank = toRank;
	}
	
	public boolean isAttacking() {
		return attacking;
	}
	
	public void setAttacking(boolean attacking) {
		this.attacking = attacking;
	}
	
	public int getPromoteType() {
		if(promoteType == '\0') return 'Q'; //default return for other pieces than pawn. could be anything - the system will not care
		else return promoteType;
	}
	
	@Override
	public String toString() {
		char letter = (char) ((char) 64 + getToFile());
		return letter + String.valueOf(getToRank());
	}
}
